// 库引入
import React, {Component} from 'react';
import {inject, observer} from 'mobx-react';
import classNames from 'classnames';

// 组件引入
import {TextLink} from '../TextLink';

// 样式引入
import styles from './item.module.less';

@observer
class Item extends Component {
  render() {
    return (
      <li
        className={classNames(styles.item, this.props.className)}
        style={this.props.style}>
        <TextLink to={this.props.to} value={this.props.value} />
      </li>
    );
  }
}

Item.defaultProps = {
  to: '/',
  value: ''
};

const InjectItem = inject(({
  someStore = {}
}) => ({someProps: someStore.attribute}))(Item);

export {Item, InjectItem};